<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/bigjo/js/jquery.js"></script>
<title>Insert title here</title>
</head>

<style type="text/css">
	#sbupdate{
		text-align: center;
		margin-left: 507px;
		margin-top: 50px;
	}
	.uptext{
		width: 300px;
		height: 100px;
	}
</style>
<script type="text/javascript">
	jQuery.noConflict();
	jQuery(".updatesboard").click(function(){
		var idx = document.URL.indexOf("bigjo");
		var str = document.URL.substring(0,idx+5);
		var s_no = jQuery(".s_no").attr("id");
		var sb_no = jQuery(this).attr("id");
		var context = jQuery(".uptext").val();
		var title = jQuery(".uptitle").val();
		if(title == ""){
			alert("제목을 입력하세요");
			return;
		}
		if(context == ""){
			alert("내용을 입력하세요");
			return;
		}
		if (confirm("수정 하시겠습니까?") == true){    //확인
			document.location.href	=	str + "/sBoardUpdate.singer?s_no="+s_no+"&sb_no="+sb_no+"&context="+context+"&title="+title;
		}else{   //취소
		return;
		}
	});
	
	
	jQuery.noConflict();
	jQuery(".updatereturn").click(function(){
		var s_no = jQuery(".s_no").attr("id");
		var idx = document.URL.indexOf("bigjo");
		var str = document.URL.substring(0,idx+5);
		if (confirm("수정을 취소하시겠습니까?") == true){    //확인
			document.location.href	= str + "/singerBoard.singer?page="+s_no+"&sb_s_no="+s_no;
		}else{   //취소
		return;
		}
		
		
		
	});
</script>

<body>
<div id="sbupdate">
<input type="hidden" class="s_no" id="${s_no}">
	<table>
		<tr><td><label>제 목 :</label></td>
		<td><input type="text" class="uptitle" style="width: 200px;" value="${sboard.sb_title}"></td></tr>
		<tr>
			<td><label>내 용 :</label></td>
			<td><textarea class="uptext">${sboard.sb_context}</textarea></td>
		</tr>
		<tr>
			<td colspan="2">
				<input type="button" id="${sboard.sb_no}" class="updatesboard" value="등록">
				<input type="button" id="${sboard.sb_no}" class="updatereturn" value="취소">
			</td>
		</tr>
	</table>
</div>
</body>
</html>